home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 43 / Amiga Format CD43 (1999)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1999-09].iso / -serious- / misc / amibroker310 / install-amibroker < prev    next >
Text File  |  1999-06-14  |  12KB  |  480 lines

  1. ; Installer Script for AmiBroker 3.10
  2. ; Revision 9
  3. ; May 22nd, 1999  Tomasz Janeczko, TJ Productions.
  4. ; $VER: Install-AmiBroker 9 (22 May 1999)
  5. ;
  6.  
  7. ; ********* English strings (default)
  8.  
  9. (set #badkick "I'm sorry, but AmiBroker requires OS 2.04 or better")
  10. (set #welcome (cat "\nAmiBroker 3.10\nHard Disk Install Script Rev 9.\n"
  11.                    "Copyright (C)1995-99 by Tomasz Janeczko\n\n"
  12.                    "This is SHAREWARE product, so if you use it you should register\n\n\n"
  13.                    "ReqTools (C)1991-95 Nico François\n"
  14.                    "SAS/C (C)1988-93 SAS Institute Inc.\n"
  15.                    "Installer (C)1991-93 Commodore-Amiga, Inc.") )
  16.  
  17. (set #destination "Where do you want to install AmiBroker? ( 'AmiBroker' drawer will be created there )" )
  18. (set #programver  "Which version of AmiBroker do you want to install" )
  19. (set #progverhelp (cat "\nAmiBroker - this version is for 68000+ processors and will work on all Amigas.\n\n"
  20.                        "AmiBroker.FPU - this version is for 68020+ and 68882 floating point coprocessor "
  21.                        "or 68040/060. Will work only on accelerated Amigas" ))
  22.  
  23. (set #olddataexist (cat "You have stock database already installed in your 'data' directory\n"
  24.                         "AmiBroker 3.0 comes with example data from Polish Stock Exchange\n"
  25.                         "Please select desired action:" ))
  26.  
  27. (set #dataexisthelp (cat "\nOption:'replace old data' will erase all existing stock data and replace them with a new database"
  28.                          "\n\nOption: 'backup old data and install new' will move your old data to separate directory. Then, new data will be installed."
  29.                          "\n\nOption 'leave untouched' won't change anything in your database (no new data will be installed)" ))
  30.  
  31. (set #replace "replace old data")
  32. (set #backup "backup old data and install new")
  33. (set #leave "leave untouched")
  34.  
  35. (set #backupinprogress (cat "Creating backup of your stock database...\n\n"
  36.                             "You'll find it in directory:\n" ))
  37.  
  38. (set #unpacking    "Unpacking AmiBroker program to:\n")
  39. (set #unpackingFPU "Unpacking AmiBroker.FPU program to:\n")
  40. (set #dearchiving  "Dearchiving database and installing files to:\n")
  41. (set #limiting     (cat "Because your Amiga is equiped with small amount of memory (less than 2MB) "
  42.                         "I have to limit the number of quotation in database to 100"))
  43.  
  44.  
  45. (set #oldkeyfile   "You have got an old 'broker.key' keyfile installed.\nYou will have to re-register in order to use full potential of AmiBroker." )
  46.  
  47. ; ********* Polish strings
  48.  
  49. (if (= @language "polski") (
  50.  
  51. (set #badkick "Bardzo mi przykro ale program AmiBroker wymaga systemu w wersji 2.04 lub wyûszej")
  52. (set #welcome (cat "\nAmiBroker 3.10\nSkrypt instalacyjny HD (Rev 9)\n"
  53.                    "Copyright (C)1995-99 by Tomasz Janeczko\n\n"
  54.                    "Program ten to SHAREWARE, chcâc wiëc go uûywaê powinieneô zarejestrowaê sië jako legalny uûytkownik\n\n\n"
  55.                    "ReqTools (C)1991-95 Nico François\n"
  56.                    "SAS/C (C)1988-93 SAS Institute Inc.\n"
  57.                    "Installer (C)1991-93 Commodore-Amiga, Inc.") )
  58.  
  59. (set #destination "Wskaû dysk lub katalog gdzie chcesz umieôciê AmiBrokera? ( Zostanie tam utworzony katalog 'AmiBroker')" )
  60. (set #programver  "Wybierz jakâ wersjë AmiBrokera chcesz zainstalowaê" )
  61. (set #progverhelp (cat "\nAmiBroker - to wersja na zwykîy procesor 68000.\n\n"
  62.                        "AmiBroker.FPU - to wersja na 68020 z koprocesorem 68882 "
  63.                        "lub teû procesory 68040 i 68060" ))
  64.  
  65. (set #olddataexist (cat "Masz juû zainstalowane dane o spóîkach i notowaniach w katalogu 'data'\n"
  66.                         "Zdecyduj co mam z nimi zrobiê:" ))
  67.  
  68. (set #dataexisthelp (cat "\nOpcja 'zastâp stare notowania nowymi' skasuje dotychczasowe dane i zainstaluje nowe w dotychczasowym podkatalogu 'data'"
  69.                          "\n\nOpcja 'utwórz kopië starych i zainstaluj nowe' przeniesie stare notowania do katalogu 'data_old', a nowe dane zapisze w katalogu 'data'"
  70.                          "\n\nOpcje 'pozostaw stare notowania' nie zainstaluje ûadnych nowych danych, pozostawiajâc tym samym stare dane bez zmian" ))
  71.  
  72. (set #replace "zastâp stare notowania nowymi")
  73. (set #backup "utwórz kopië starych i zainstaluj nowe")
  74. (set #leave "pozostaw stare notowania")
  75.  
  76. (set #backupinprogress (cat "Tworzë kopie starych notowaï...\n\n"
  77.                             "Znajdziesz je w katalogu:\n" ))
  78.  
  79. (set #unpacking    "Rozpakowujë program AmiBroker do katalogu:\n")
  80. (set #unpackingFPU "Rozpakowujë program AmiBroker.FPU do katalogu:\n")
  81. (set #dearchiving  "Rozpakowujë archiwum i instalujë nowe notowania do katalogu:\n")
  82. (set #limiting     (cat "Poniewaû Twoja Amiga jest wyposaûona w niewielkâ iloôê pamiëci (mniej niû 2MB) "
  83.                         "muszë ograniczyê iloôê notowaï w bazie danych do 100"))
  84.  
  85. (set #oldkeyfile   "Masz zainstalowanâ starâ wersjë pliku kluczowego 'broker.key'.\nBëdziesz musiaî zarejestrowaê sië ponownie by uûywaê wszystkich funkcji AmiBrokera." )
  86.  
  87. ))
  88.  
  89. ; ******* main install part
  90.  
  91. ; set up an error cleanup routine
  92. (onerror
  93.         (makeassign "AmiBrokerinstpgm" (safe))
  94. )
  95.  
  96. ; check OS version
  97.  
  98. (if (< (/ (getversion) 65536) 37)
  99.     (
  100.         (message #badkick)
  101.         (exit (quiet))
  102.     )
  103. )
  104.  
  105. ;just started
  106. (complete 0)
  107.  
  108. (message #welcome)
  109.  
  110. (welcome)
  111.  
  112. ;cancel the assign in case of installation restart
  113. (makeassign "AmiBrokerinstpgm" (safe))
  114.  
  115.  
  116. ; get the dest dir for AmiBroker
  117. (set AmiBroker_dest
  118.         (tackon
  119.                 (askdir
  120.                         (prompt #destination)
  121.                         (help @askdir-help)
  122.                         (default @default-dest)
  123.                 )
  124.                 "AmiBroker"
  125.         )
  126. )
  127.  
  128.  
  129. (complete 10)
  130.  
  131.  
  132. ;We now have a valid destination, so tell Installer where AmiBroker will end up
  133. ;so the exit page will be correct.
  134. (set @default-dest AmiBroker_dest)
  135.  
  136. ;
  137. ; Ask which files one wants to have installed
  138. ;
  139. ;
  140.  
  141. (set progver 1)
  142.  
  143. (if (OR (exists "AmiBroker.FPU") (exists "AmiBroker.FPU.lha") )
  144.    (set progver (askoptions
  145.                  (prompt #programver )
  146.                  (help  #progverhelp )
  147.                   (choices
  148.                     "AmiBroker"
  149.                     "AmiBroker.FPU"
  150.                   )
  151.                  (default 3)
  152.                 )
  153.    )
  154. )
  155.  
  156. ;copy program files from source to dest
  157.  
  158. (if (IN progver 0)
  159.  (if (exists "AmiBroker")
  160.    (copyfiles
  161.      (source "AmiBroker")
  162.      (dest AmiBroker_dest)
  163.      (infos)
  164.    )
  165.    (;else
  166.      (working #unpacking AmiBroker_dest )
  167.      (run (cat "lha -qf x AmiBroker.lha \"" (tackon AmiBroker_dest "\"" ) ) )
  168.    )
  169.  )
  170. )
  171.  
  172. (complete 10)
  173.  
  174. (if (IN progver 1)
  175.  (if (exists "AmiBroker.FPU")
  176.    (copyfiles
  177.      (source "AmiBroker.FPU")
  178.      (dest AmiBroker_dest)
  179.      (infos)
  180.    )
  181.    (;else
  182.      (working #unpackingFPU AmiBroker_dest )
  183.      (run (cat "lha -qf x AmiBroker.FPU.lha \"" (tackon AmiBroker_dest "\"" ) ) )
  184.    )
  185.  )
  186. )
  187.  
  188. (complete 20)
  189.  
  190. (makedir (tackon AmiBroker_dest "Locale") )
  191.  
  192. (copyfiles
  193.   (source "Locale")
  194.   (dest (tackon AmiBroker_Dest "Locale" ) )
  195.   (all)
  196.   (infos)
  197. )
  198.  
  199. (copyfiles
  200.   (source "Locale.info")
  201.   (dest   AmiBroker_Dest )
  202. )
  203.  
  204. (copyfiles
  205.   (source "Locale/Catalogs")
  206.   (dest "LOCALE:Catalogs" )
  207.   (all)
  208. )
  209.  
  210.  
  211. (copyfiles
  212.   (source "AmiBroker.guide.info")
  213.   (dest   AmiBroker_Dest)
  214.   (all)
  215. )
  216.  
  217. (if (= @language "polski")
  218.      (copyfiles
  219.        (source "Locale/Guides/polski/AmiBroker.guide")
  220.        (dest AmiBroker_dest)
  221.      )
  222.      (copyfiles
  223.        (source "Locale/Guides/english/AmiBroker.guide")
  224.        (dest AmiBroker_dest)
  225.      )
  226. )
  227.  
  228. (copyfiles
  229.   (source "Classes")
  230.   (dest   "SYS:Classes" )
  231.   (all)
  232. )
  233.  
  234. (complete 30)
  235.  
  236. (copyfiles
  237.   (source "AmiBroker.history")
  238.   (dest AmiBroker_dest)
  239.   (infos)
  240. )
  241.  
  242. (copyfiles
  243.   (source "ReadMe")
  244.   (dest AmiBroker_dest)
  245.   (infos)
  246. )
  247.  
  248. ; delete old data file if exists
  249. (if (exists (tackon AmiBroker_dest "broker.data"))
  250.     (delete (tackon AmiBroker_dest "broker.data"))
  251. )
  252.  
  253.  
  254. (if (exists (tackon AmiBroker_dest "data"))
  255.     (set datmode (askchoice
  256.                   (prompt #olddataexist)
  257.                   (help #dataexisthelp )
  258.                   (default 1)
  259.                   (choices
  260.                      #replace
  261.                      #backup
  262.                      #leave
  263.                   )
  264.                  )
  265.     )
  266. )
  267.  
  268.  
  269. (if (= datmode 1) (
  270.        (makedir (tackon AmiBroker_dest "data_old") )
  271.        (working #backupinprogress (tackon AmiBroker_dest "data_old"))
  272.        (copyfiles
  273.                (source (tackon AmiBroker_dest "data") )
  274.                (dest   (tackon AmiBroker_dest "data_old") )
  275.                (all)
  276.                (nogauge)
  277.        )
  278. ))
  279.  
  280. (complete 40)
  281.  
  282. (makedir (tackon AmiBroker_dest "data") )
  283.  
  284. (if (< datmode 2)
  285.         (if (exists "data")
  286.             (copyfiles
  287.                  (source "data")
  288.                  (dest   (tackon AmiBroker_dest "data") )
  289.                  (all)
  290.             )
  291.             (;else
  292.                  (working #dearchiving (tackon AmiBroker_dest "data"))
  293.                  (makeassign "AmiBrokerData" (tackon AmiBroker_dest "data") (safe))
  294.                  (run "lha -qf x abdata.lha AmiBrokerData:" )
  295.                  (makeassign "AmiBrokerData" (safe))
  296.             )
  297.         )
  298.  
  299. )
  300.  
  301.  
  302. (complete 60)
  303.  
  304. (set #freemem (database "total-mem") )
  305.  
  306. (if (< (- #freemem 2000000) 0)
  307.   (
  308.      (working #limiting)
  309.      (makeassign "AmiBrokerData" (tackon AmiBroker_dest "data") (safe))
  310.      (run "ConvertData >NIL: AmiBrokerData: 100" )
  311.      (makeassign "AmiBrokerData" (safe))
  312.   )
  313. )
  314.  
  315. (working)
  316.  
  317. (if (NOT (exists (tackon AmiBroker_dest "broker.portfolio") ) )
  318.     (copyfiles
  319.      (source "broker.portfolio")
  320.      (dest AmiBroker_dest)
  321.     )
  322. )
  323.  
  324. (if (exists (tackon AmiBroker_dest "broker.key") )
  325.     (if (< (/ (getversion (tackon AmiBroker_dest "broker.key") ) 65536) 20)
  326.         (message #oldkeyfile)
  327.     )
  328. )
  329.  
  330. ; copy key-file if exists
  331. (if (exists "broker.key")
  332.     (copyfiles
  333.      (source "broker.key")
  334.      (dest AmiBroker_dest)
  335.     )
  336. )
  337.  
  338. ; copy arexx-file if exists
  339. (if (exists "broker.arexx")
  340.     (if (NOT (exists (tackon AmiBroker_dest "broker.arexx" ) ) )
  341.         (copyfiles
  342.          (source "broker.arexx")
  343.          (dest AmiBroker_dest)
  344.          )
  345.     )
  346. )
  347.  
  348.  
  349. ; copy Trading rules file if exists
  350. (if (exists "broker.rules")
  351.     (if (NOT (exists (tackon AmiBroker_dest "broker.rules" ) ) )
  352.         (copyfiles
  353.          (source "broker.rules")
  354.          (dest AmiBroker_dest)
  355.          )
  356.     )
  357. )
  358.  
  359. ; copy Guru commentaries if exists
  360. (if (exists "broker.comment")
  361.     (if (NOT (exists (tackon AmiBroker_dest "broker.comment" ) ) )
  362.         (copyfiles
  363.          (source "broker.comment")
  364.          (dest AmiBroker_dest)
  365.          )
  366.     )
  367. )
  368.  
  369.  
  370. ; copy Custom charts if exists
  371. (if (exists "broker.charts")
  372.     (if (NOT (exists (tackon AmiBroker_dest "broker.charts" ) ) )
  373.         (copyfiles
  374.          (source "broker.charts")
  375.          (dest AmiBroker_dest)
  376.          )
  377.     )
  378. )
  379.  
  380. (complete 70)
  381.  
  382. ; delete old BrokerSymbol font (1.22 and earlier vers) if exists
  383. (if (exists "FONTS:BrokerSym.font")
  384.     (delete "FONTS:BrokerSym.font")
  385. )
  386.  
  387. (if (exists "FONTS:BrokerSym/16")
  388.     (delete "FONTS:BrokerSym/16")
  389. )
  390.  
  391. (if (exists "FONTS:BrokerSym")
  392.     (delete "FONTS:BrokerSym")
  393. )
  394.  
  395. ; copy fonts needed
  396. (copyfiles
  397.   (source "fonts")
  398.   (dest "FONTS:")
  399.   (fonts)
  400.   (all)
  401. )
  402.  
  403.  
  404. (complete 80)
  405.  
  406. (copyfiles
  407.   (source "ARexxDemo.abrx")
  408.   (dest AmiBroker_dest)
  409.   (infos)
  410. )
  411.  
  412. (makedir (tackon AmiBroker_dest "Examples") )
  413.  
  414. (copyfiles
  415.   (source "Examples")
  416.   (dest (tackon AmiBroker_Dest "Examples" ) )
  417.   (all)
  418. )
  419.  
  420.  
  421. (makedir (tackon AmiBroker_dest "Metastock") )
  422.  
  423. (copyfiles
  424.   (source "Metastock")
  425.   (dest (tackon AmiBroker_Dest "Metastock" ) )
  426.   (all)
  427. )
  428.  
  429.  
  430. (makedir (tackon AmiBroker_dest "Teletext") )
  431.  
  432. (copyfiles
  433.   (source "Teletext")
  434.   (dest (tackon AmiBroker_Dest "Teletext" ) )
  435.   (all)
  436. )
  437.  
  438.  
  439. (makedir (tackon AmiBroker_dest "Rexx") )
  440.  
  441. (copyfiles
  442.   (source "Rexx")
  443.   (dest (tackon AmiBroker_Dest "Rexx" ) )
  444.   (all)
  445. )
  446.  
  447.  
  448. (makedir (tackon AmiBroker_dest "AFL") )
  449.  
  450. (copyfiles
  451.   (source "AFL")
  452.   (dest (tackon AmiBroker_Dest "AFL" ) )
  453.   (all)
  454.   (infos)
  455. )
  456.  
  457. (copyfiles
  458.   (source "AFL.info")
  459.   (dest   AmiBroker_Dest )
  460. )
  461.  
  462.  
  463.  
  464. (complete 90)
  465.  
  466. ;un-snapshot the AmiBroker drawer icon
  467. (tooltype
  468.         (dest AmiBroker_dest)
  469.         (noposition)
  470. )
  471.  
  472. ;done with the install
  473. (complete 100)
  474.  
  475. ;cleanup
  476. (makeassign "AmiBrokerinstpgm" (safe))
  477.  
  478. ;and get out
  479. (exit)
  480.